<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CreateAdminGroupRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'group_name'      => 'required|unique:admin_groups',
            'description'     => 'required',
        ];
    }

    public function messages(){
        return [
            'group_name.required' => '角色名必填',
            'group_name.unique' => '角色名已使用，请重新填写',
            'description.required' => '请填写描述信息',
        ];
    }
}
